﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace Jy123.Web.Manage.User.Letter
{
    public partial class Notice : MgConfig//System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Verify("Notice.aspx");
        }

        protected void btnAddNotice_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Jy123.Model.User_Letter mUserLetter = new Jy123.Model.User_Letter();
                Jy123.BLL.User_Letter bllUserLetter = new Jy123.BLL.User_Letter();
                mUserLetter.FUserReceiver = 0;
                mUserLetter.FUserSender = 0;
                mUserLetter.SenderName = "系统通知";
                mUserLetter.Title = txtTitle.Text;
                mUserLetter.LetterContent = txtContent.Text;
                mUserLetter.PostTime = DateTime.Now;
                mUserLetter.PostIP = Common.Public.GetClientIP();
                mUserLetter.LtType = 0;
                mUserLetter.IsRead = 0;
                mUserLetter.IsReply = false;
                mUserLetter.IsDel = 0;
                if (bllUserLetter.Add(mUserLetter) > 0)
                {
                    Response.Redirect("Notice.aspx");
                    MessageBox("发送成功", MsgType.ok);
                }
            }
        }
    }
}
